//
//  OrderRowView.m
//  beautyAccompany
//
//  Created by xiaocankeji on 15/11/17.
//  Copyright © 2015年 xiaocankeji. All rights reserved.
//

#import "OrderRowView.h"
#define kIconHeight 20

@interface OrderRowView ()
@property (nonatomic, strong) UIImageView *icon;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *lineView;


@end


@implementation OrderRowView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _icon = [[UIImageView alloc] init];
        [self addSubview:_icon];
    
        
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.text = @"类型";
        _titleLabel.font = kFont(14);
        _titleLabel.textColor = RGBA(188, 188, 188, 1);
        [self addSubview:_titleLabel];
        _lineView = [[UIView alloc] initWithFrame:CGRectMake(100, frame.size.height- 0.5, DeviceWidth-100, 0.5)];
        _lineView.backgroundColor = RGBA(222, 222, 222, 0.8);
        [self addSubview:_lineView];
        
        
    }
    return self;
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    _titleLabel.text = title;
}
- (void)setImg:(UIImage *)img
{
    _img = img;
    _icon.image = img;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _icon.frame = CGRectMake(15, self.height/2-kIconHeight/2, kIconHeight, kIconHeight);
    _titleLabel.frame = CGRectMake(15+kIconHeight+15, self.height/2-kIconHeight/2, 40, kIconHeight);
    _lineView.frame = CGRectMake(100, self.frame.size.height - 0.5, DeviceWidth - 100, 0.5);
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
